﻿using System;
using System.Collections.Generic;
using Plugins.Interfaces;

namespace Plugins.StateMachines
{

    [Serializable]
    public class PluginState<T> : PluginBaseState, IPluginState<T> where T : class
    {
        private PluginEnumerator<T> _enumerator;
        public PluginState(PluginBaseState handler, Factory<IEnumerable<T>> factory) : base(handler) { _enumerator = new PluginEnumerator<T>(factory); }
        protected PluginEnumerator<T> Values { get { return _enumerator; } }
        IPluginState IPluginState.Next { set { BaseSetNextState(value); } }
        IPluginState IPluginState.Current { set { BaseSetCurrentState(value); } }
        T IPluginState<T>.Value { set { BaseSetValue(value); } }
    }
}
